package org.tangolyricstagger.model;

import lombok.AllArgsConstructor;
import lombok.Getter;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

@Getter
@AllArgsConstructor
public class GenreStatistics {
    public String genre;
    public Long count;

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(genre).toHashCode();
    }

    @Override
    public boolean equals(Object other) {
        if (other instanceof GenreStatistics) {
            GenreStatistics castOther = (GenreStatistics) other;
            return new EqualsBuilder().append(genre, castOther.getGenre()).isEquals();
        } else {
            return false;
        }
    }

    public void increment() {
        count++;
    }

}
